import type { CardListData,CardListParams,CardParams,CardDetail } from "@/types/card";
import { request } from "@/utils/reuqest";
/**登录接口封装
* @ description:登录接口封装
* @ param {*} data {mobile,password}
* @ return {*} promise
* */
export const getCardListAPI=(params:CardListParams)=>{
  return request<CardListData>('/parking/card/list', 'GET', params)
}

// 添加月卡
export const createCardAPI=(params:Partial<CardParams>)=>{
  return request('/parking/card', 'POST', params)

}
//获取编辑月卡
export const getCardDetailAPI=(id:string)=>{
  return request<CardDetail>(`/parking/card/detail/${id}`, 'GET')
}
//编辑月卡
export const updateCardAPI=(data:Partial<CardDetail>)=>{
  return request('/parking/card/edit', 'PUT', data)
}
//删除月卡
export const delCardAPI =(ids:number[])=>{
  return request(`/parking/card/${ids.join(',')}`,'DELETE')
}